function loadCity(type,css){
  var province = document.getElementById("province").value;
  if(province!=""||province!=0){
    document.getElementById("cityDiv").style.display="block";
    var city = document.getElementById("city").value;
    var type = type;var css=css;
    $.ajax({
    	url:'../ajax/loadArea.php',
        type:'post',
        data:{act:'citysel',type:type,province:province,city:city,css:css},
        success:function(data){
          document.getElementById("cityDiv").innerHTML = data;
        },
		error:function(erg){
			document.getElementById("cityDiv").innerHTML = "加载失败...";
		}
	});
  }else{
    document.getElementById("cityDiv").style.display="none";
  }
}

function loadArea(type,css){
	  var city = document.getElementById("city").value;
	  if(city!=""||city!=0){
	    document.getElementById("areaDiv").style.display="block";
	    var area = document.getElementById("area").value;
	    var type = type;var css=css;
	    $.ajax({
	    	url:'../ajax/loadArea.php',
	        type:'post',
	        data:{act:'areasel',type:type,city:city,area:area,css:css},
	        success:function(data){
	          document.getElementById("areaDiv").innerHTML = data;
	        },
			error:function(erg){
				document.getElementById("areaDiv").innerHTML = "加载失败...";
			}
		});
	  }else{
	    document.getElementById("areaDiv").style.display="none";
	  }
	}

/*日期范围是否正确*/
function checkdate(){
   		var t1 = document.getElementById("t1");
   		var t2 = document.getElementById("t2");

   		if((t1.value!="")&&(t2.value!="")){
   			if(t1.value>t2.value){
   				ymPrompt.errorInfo({title:'查询提示',message:'日期范围错误'});
   				return false;
   			}else{
   				return true;
   			}
   		}else{
   			return true;
   		}
  	}

/*下拉选定*/
function formSubmit(){
	if(checkdate()==false)return false;
	document.getElementById("select_form").submit();
}

/*delete div show*/
function del_cause(del_id,company_name){
	document.getElementById('del_company').innerHTML=company_name;
	document.getElementById('delete_id').value=del_id;
    $("#why_del").show();
  }

function del_close(){
	var hint=document.getElementById('cause_hint');
	hint.innerHTML="";
    $("#why_del").hide();
}
function check_cause(form){
	var reg = /^\s*$/;
	if(form.del_cause.value==""||reg.test(form.del_cause.value)==true){
		var hint=document.getElementById('cause_hint');
		hint.innerHTML="请输入删除原因";
		return false;
	}else if(form.del_cause.value.length>600){
		var hint=document.getElementById('cause_hint');
		hint.innerHTML="删除原因600字以内";
		return false;
	}
	else{
		return true;
	}
}